import sys

from loguru import logger

from config.settings import LOGGER_LEVEL


class LogFactory:
    __logger = None

    @classmethod
    def get_log(cls):
        if not cls.__logger:
            cls.__logger = logger
            cls.__logger.remove(0)
            cls.__logger.add(sys.stdout, level=LOGGER_LEVEL, serialize=False)
        return cls.__logger
